package cn.kgc.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.awt.*;
import java.util.List;

/**
 * 封装业务层的数据，返回前端
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class PageSupport<T> {
    //页码
    private Integer pageNo=1;
    //页大小
    private Integer pageSize=5;
    //总记录数
    private Integer totalcount;
    //总页数
    private Integer totalPage;
    //数据
    private List<T> data;

    public Integer getTotalPage(){
        return totalcount%pageSize==0?(totalcount/pageSize):(totalcount/pageSize)+1;
    }

}
